package com.hxzy.controller.userinfo;

import com.alibaba.fastjson.JSONObject;
import com.hxzy.util.ThreadLocalUtil;
import com.hxzy.common.BaseServlet;
import com.hxzy.common.ResultAjax;
import com.hxzy.entity.UserInfo;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description:
 * @Author: ykj
 * @Date: 2022/3/7 19:19
 */
@WebServlet(urlPatterns = "/user/info")
public class UserInfoServlet extends BaseServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        UserInfo userInfo = ThreadLocalUtil.threadLocal.get();
        ResultAjax resultAjax = ResultAjax.succss_data(userInfo);
        super.render(resp, JSONObject.toJSONString(resultAjax));
    }
}
